home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / blockade.c < prev    next >
C/C++ Source or Header  |  2000-04-23  |  23KB  |  710 lines

  1. /****************************************************************************
  2.  
  3. Blockade/Comotion/Blasto/Hustle Memory MAP
  4. Frank Palazzolo (palazzol@home.com)
  5.  
  6. CPU - Intel 8080A
  7.  
  8. Memory Address              (Upper/Lower)
  9.  
  10. 0xxx 00aa aaaa aaaa     ROM     U2/U3    R       1K for Blockade/Comotion/Blasto
  11. 0xxx 01aa aaaa aaaa     ROM     U4/U5    R       1K for Comotion/Blasto/Hustle Only
  12. xxx1 xxxx aaaa aaaa     RAM              R/W     256 bytes
  13. 1xx0 xxaa aaaa aaaa    VRAM                      1K playfield
  14.  
  15.                     CHAR ROM  U29/U43            256 bytes for Blockade/Comotion
  16.                                                  512 for Blasto/Hustle
  17.  
  18. Ports    In            Out
  19. 1        Controls      bit 7 = Coin Latch Reset
  20.                        bit 5 = Pin 19?
  21. 2        Controls      Square Wave Pitch Register
  22. 4        Controls      Noise On
  23. 8        N/A           Noise Off
  24.  
  25.  
  26. Notes:  Support is complete with the exception of the square wave generator
  27.         and noise generator.  I have not created a sample for the noise
  28.         generator, but any BOOM sound as a sample will do for now for
  29.         Blockade & Comotion, at least.
  30.  
  31. ****************************************************************************/
  32.  
  33.  
  34. #include "driver.h"
  35. #include "vidhrdw/generic.h"
  36.  
  37. /* #define BLOCKADE_LOG 1 */
  38.  
  39. /* in vidhrdw */
  40. void blockade_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  41.  
  42. WRITE_HANDLER( blockade_coin_latch_w );
  43. WRITE_HANDLER( blockade_sound_freq_w );
  44. WRITE_HANDLER( blockade_env_on_w );
  45. WRITE_HANDLER( blockade_env_off_w );
  46.  
  47. /* These are used to simulate coin latch circuitry */
  48.  
  49. static int coin_latch;  /* Active Low */
  50. static int just_been_reset;
  51.  
  52. void init_blockade(void)
  53. {
  54.     unsigned char *rom = memory_region(REGION_CPU1);
  55.     int i;
  56.  
  57.     /* Merge nibble-wide roms together,
  58.        and load them into 0x0000-0x0400 */
  59.  
  60.     for (i = 0;i < 0x0400;i++)
  61.     {
  62.         rom[0x0000+i] = (rom[0x1000+i]<<4)+rom[0x1400+i];
  63.     }
  64.  
  65.     /* Initialize the coin latch state here */
  66.     coin_latch = 1;
  67.     just_been_reset = 0;
  68. }
  69.  
  70. void init_comotion(void)
  71. {
  72.     unsigned char *rom = memory_region(REGION_CPU1);
  73.     int i;
  74.  
  75.     /* Merge nibble-wide roms together,
  76.        and load them into 0x0000-0x0800 */
  77.  
  78.     for(i = 0;i < 0x0400;i++)
  79.     {
  80.         rom[0x0000+i] = (rom[0x1000+i]<<4)+rom[0x1400+i];
  81.         rom[0x0400+i] = (rom[0x1800+i]<<4)+rom[0x1c00+i];
  82.     }
  83.  
  84.     /* They also need to show up here for comotion/blasto */
  85.  
  86.     for(i = 0;i < 2048;i++)
  87.     {
  88.         rom[0x4000+i] = rom[0x0000+i];
  89.     }
  90.  
  91.     /* Initialize the coin latch state here */
  92.     coin_latch = 1;
  93.     just_been_reset = 0;
  94. }
  95.  
  96. /*************************************************************/
  97. /*                                                           */
  98. /* Inserting a coin should work like this:                   */
  99. /*  1) Reset the CPU                                         */
  100. /*  2) CPU Sets the coin latch                               */
  101. /*  3) Finally the CPU coin latch is Cleared by the hardware */
  102. /*     (by the falling coin..?)                              */
  103. /*                                                           */
  104. /*  I am faking this by keeping the CPU from Setting         */
  105. /*  the coin latch if we have just been reset.               */
  106. /*                                                           */
  107. /*************************************************************/
  108.  
  109.  
  110. /* Need to check for a coin on the interrupt, */
  111. /* This will reset the cpu                    */
  112.  
  113. int blockade_interrupt(void)
  114. {
  115.     timer_suspendcpu(0, 0, SUSPEND_ANY_REASON);
  116.  
  117.     if ((input_port_0_r(0) & 0x80) == 0)
  118.     {
  119.         just_been_reset = 1;
  120.         cpu_set_reset_line(0,PULSE_LINE);
  121.     }
  122.  
  123.     return ignore_interrupt();
  124. }
  125.  
  126. READ_HANDLER( blockade_input_port_0_r )
  127. {
  128.     /* coin latch is bit 7 */
  129.  
  130.     int temp = (input_port_0_r(0)&0x7f);
  131.     return (coin_latch<<7) | (temp);
  132. }
  133.  
  134. WRITE_HANDLER( blockade_coin_latch_w )
  135. {
  136.     if (data & 0x80)
  137.     {
  138.     #ifdef BLOCKADE_LOG
  139.         printf("Reset Coin Latch\n");
  140.     #endif
  141.         if (just_been_reset)
  142.         {
  143.             just_been_reset = 0;
  144.             coin_latch = 0;
  145.         }
  146.         else
  147.             coin_latch = 1;
  148.     }
  149.  
  150.     if (data & 0x20)
  151.     {
  152.     #ifdef BLOCKADE_LOG
  153.         printf("Pin 19 High\n");
  154.     #endif
  155.     }
  156.     else
  157.     {
  158.     #ifdef BLOCKADE_LOG
  159.         printf("Pin 19 Low\n");
  160.     #endif
  161.     }
  162.  
  163.     return;
  164. }
  165.  
  166. WRITE_HANDLER( blockade_sound_freq_w )
  167. {
  168. #ifdef BLOCKADE_LOG
  169.     printf("Sound Freq Write: %d\n",data);
  170. #endif
  171.     return;
  172. }
  173.  
  174. WRITE_HANDLER( blockade_env_on_w )
  175. {
  176. #ifdef BLOCKADE_LOG
  177.     printf("Boom Start\n");
  178. #endif
  179.     sample_start(0,0,0);
  180.     return;
  181. }
  182.  
  183. WRITE_HANDLER( blockade_env_off_w )
  184. {
  185. #ifdef BLOCKADE_LOG
  186.     printf("Boom End\n");
  187. #endif
  188.     return;
  189. }
  190.  
  191. static WRITE_HANDLER( blockade_videoram_w )
  192. {
  193.     videoram_w(offset, data);
  194.     if (input_port_3_r(0) & 0x80)
  195.     {
  196.         logerror("blockade_videoram_w: scanline %d\n", cpu_getscanline());
  197.         cpu_spinuntil_int();
  198.     }
  199. }
  200.  
  201. static struct MemoryReadAddress readmem[] =
  202. {
  203.     { 0x0000, 0x07ff, MRA_ROM },
  204.     { 0x4000, 0x47ff, MRA_ROM },  /* same image */
  205.     { 0xe000, 0xe3ff, videoram_r },
  206.     { 0xff00, 0xffff, MRA_RAM },
  207.     { -1 }  /* end of table */
  208. };
  209.  
  210. static struct MemoryWriteAddress writemem[] =
  211. {
  212.     { 0x0000, 0x07ff, MWA_ROM },
  213.     { 0x4000, 0x47ff, MWA_ROM },  /* same image */
  214.     { 0xe000, 0xe3ff, blockade_videoram_w, &videoram, &videoram_size },
  215.     { 0xff00, 0xffff, MWA_RAM },
  216.     { -1 }  /* end of table */
  217. };
  218.  
  219. static struct IOReadPort readport[] =
  220. {
  221.     { 0x01, 0x01, blockade_input_port_0_r },
  222.     { 0x02, 0x02, input_port_1_r },
  223.     { 0x04, 0x04, input_port_2_r },
  224.     { -1 }  /* end of table */
  225. };
  226.  
  227. static struct IOWritePort writeport[] =
  228. {
  229.     { 0x01, 0x01, blockade_coin_latch_w },
  230.     { 0x02, 0x02, blockade_sound_freq_w },
  231.     { 0x04, 0x04, blockade_env_on_w },
  232.     { 0x08, 0x08, blockade_env_off_w },
  233.     { -1 }  /* end of table */
  234. };
  235.  
  236. /* These are not dip switches, they are mapped to */
  237. /* connectors on the board.  Different games had  */
  238. /* different harnesses which plugged in here, and */
  239. /* some pins were unused.                         */
  240.  
  241. INPUT_PORTS_START( blockade )
  242.     PORT_START  /* IN0 */
  243.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
  244.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  245.     PORT_DIPNAME(    0x04, 0x04, "Boom Switch" )
  246.     PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
  247.     PORT_DIPSETTING( 0x04, DEF_STR( On ) )
  248.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  249.     PORT_DIPNAME(    0x70, 0x70, DEF_STR( Lives ) )
  250.     PORT_DIPSETTING( 0x60, "3" )
  251.     PORT_DIPSETTING( 0x50, "4" )
  252.     PORT_DIPSETTING( 0x30, "5" )
  253.     PORT_DIPSETTING( 0x70, "6" )
  254.     PORT_BIT_IMPULSE( 0x80, IP_ACTIVE_LOW, IPT_COIN1, 1 )
  255.                                 /* this is really used for the coin latch,  */
  256.                                 /* see blockade_interrupt()                 */
  257.  
  258.     PORT_START  /* IN1 */
  259.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_PLAYER2 )
  260.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_PLAYER2 )
  261.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_PLAYER2 )
  262.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_PLAYER2 )
  263.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_PLAYER1 )
  264.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_PLAYER1 )
  265.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_PLAYER1 )
  266.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_PLAYER1 )
  267.  
  268.     PORT_START  /* IN2 */
  269.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
  270.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  271.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  272.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  273.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  274.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  275.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  276.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  277.  
  278.     PORT_START    /* IN3 */
  279.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
  280.     PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNKNOWN )
  281. INPUT_PORTS_END
  282.  
  283. INPUT_PORTS_START( comotion )
  284.     PORT_START  /* IN0 */
  285.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
  286.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  287.     PORT_DIPNAME(    0x04, 0x04, "Boom Switch" )
  288.     PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
  289.     PORT_DIPSETTING( 0x04, DEF_STR( On ) )
  290.     PORT_DIPNAME(    0x00, 0x08, DEF_STR( Lives ) )
  291.     PORT_DIPSETTING( 0x00, "3" )
  292.     PORT_DIPSETTING( 0x08, "4" )
  293.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
  294.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  295.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  296.     PORT_BIT_IMPULSE( 0x80, IP_ACTIVE_LOW, IPT_COIN1, 1 )
  297.                                 /* this is really used for the coin latch,  */
  298.                                 /* see blockade_interrupt()                 */
  299.  
  300.     PORT_START  /* IN1 */
  301.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_PLAYER1 )
  302.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_PLAYER1 )
  303.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_PLAYER1 )
  304.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_PLAYER1 )
  305.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_PLAYER3 )
  306.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_PLAYER3 )
  307.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_PLAYER3 )
  308.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_PLAYER3 )
  309.  
  310.     PORT_START  /* IN2 */
  311.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_PLAYER2 )
  312.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_PLAYER2 )
  313.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_PLAYER2 )
  314.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_PLAYER2 )
  315.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_PLAYER4 )
  316.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_PLAYER4 )
  317.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_PLAYER4 )
  318.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_PLAYER4 )
  319.  
  320.     PORT_START    /* IN3 */
  321.     PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNKNOWN )
  322.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
  323. INPUT_PORTS_END
  324.  
  325. INPUT_PORTS_START( blasto )
  326.     PORT_START  /* IN0 */
  327.     PORT_DIPNAME(    0x03, 0x03, DEF_STR( Coinage ) )
  328.     PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) )
  329.     PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) )
  330.     PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) )
  331.     PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) )
  332.     PORT_DIPNAME(    0x04, 0x04, "Boom Switch" )
  333.     PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
  334.     PORT_DIPSETTING( 0x04, DEF_STR( On ) )
  335.     PORT_DIPNAME(    0x08, 0x08, "Game Time" )
  336.     PORT_DIPSETTING( 0x00, "70 Secs" )
  337.     PORT_DIPSETTING( 0x08, "90 Secs" )
  338.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  339.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  340.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  341.     PORT_BIT_IMPULSE( 0x80, IP_ACTIVE_LOW, IPT_COIN1, 1 )
  342.                                 /* this is really used for the coin latch,  */
  343.                                 /* see blockade_interrupt()                 */
  344.  
  345.     PORT_START  /* IN1 */
  346.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  347.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  348.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  349.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  350.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  351.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
  352.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  353.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  354.  
  355.     PORT_START  /* IN2 */
  356.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_PLAYER2 )
  357.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_PLAYER2 )
  358.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_PLAYER2 )
  359.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_PLAYER2 )
  360.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_PLAYER1 )
  361.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_PLAYER1 )
  362.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_PLAYER1 )
  363.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_PLAYER1 )
  364.  
  365.     PORT_START    /* IN3 */
  366.     PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNKNOWN )
  367.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
  368. INPUT_PORTS_END
  369.  
  370. INPUT_PORTS_START( hustle )
  371.     PORT_START  /* IN0 */
  372.     PORT_DIPNAME(    0x03, 0x03, DEF_STR( Coinage ) )
  373.     PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) )
  374.     PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) )
  375.     PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) )
  376.     PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) )
  377.     PORT_DIPNAME(    0x04, 0x04, "Game Time" )
  378.     PORT_DIPSETTING( 0x00, "1.5 mins" )
  379.     PORT_DIPSETTING( 0x04, "2 mins" )
  380.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  381.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
  382.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  383.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  384.     PORT_BIT_IMPULSE( 0x80, IP_ACTIVE_LOW, IPT_COIN1, 1 )
  385.                                 /* this is really used for the coin latch,  */
  386.                                 /* see blockade_interrupt()                 */
  387.  
  388.     PORT_START  /* IN1 */
  389.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_PLAYER2 )
  390.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_PLAYER2 )
  391.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_PLAYER2 )
  392.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_PLAYER2 )
  393.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_PLAYER1 )
  394.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_PLAYER1 )
  395.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_PLAYER1 )
  396.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_PLAYER1 )
  397.  
  398.     PORT_START  /* IN2 */
  399.     PORT_DIPNAME( 0xf1, 0xf0, "Free Game" )
  400.     PORT_DIPSETTING ( 0x71, "11000" )
  401.     PORT_DIPSETTING ( 0xb1, "13000" )
  402.     PORT_DIPSETTING ( 0xd1, "15000" )
  403.     PORT_DIPSETTING ( 0xe1, "17000" )
  404.     PORT_DIPSETTING ( 0xf0, "Disabled" )
  405.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  406.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  407.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  408.  
  409.     PORT_START    /* IN3 */
  410.     PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNKNOWN )
  411.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
  412. INPUT_PORTS_END
  413.  
  414.  
  415.  
  416. static struct GfxLayout blockade_layout =
  417. {
  418.     8,8,    /* 8*8 characters */
  419.     32, /* 32 characters */
  420.     1,  /* 1 bit per pixel */
  421.     { 0 },  /* no separation in 1 bpp */
  422.     { 4,5,6,7,256*8+4,256*8+5,256*8+6,256*8+7 },    /* Merge nibble-wide roms */
  423.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  424.     8*8 /* every char takes 8 consecutive bytes */
  425. };
  426.  
  427. static struct GfxLayout blasto_layout =
  428. {
  429.     8,8,    /* 8*8 characters */
  430.     64, /* 64 characters */
  431.     1,  /* 1 bit per pixel */
  432.     { 0 },  /* no separation in 1 bpp */
  433.     { 4,5,6,7,512*8+4,512*8+5,512*8+6,512*8+7 },    /* Merge nibble-wide roms */
  434.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  435.     8*8 /* every char takes 8 consecutive bytes */
  436. };
  437.  
  438. static struct GfxDecodeInfo gfxdecodeinfo[] =
  439. {
  440.     { REGION_GFX1, 0x0000, &blockade_layout, 0, 2 },
  441.     { -1 } /* end of array */
  442. };
  443.  
  444. static struct GfxDecodeInfo blasto_gfxdecodeinfo[] =
  445. {
  446.     { REGION_GFX1, 0x0000, &blasto_layout,   0, 2 },
  447.     { -1 } /* end of array */
  448. };
  449.  
  450.  
  451. static unsigned char gr_palette[] =
  452. {
  453.     0x00,0x00,0x00, /* BLACK */
  454.     0x00,0xff,0x00, /* GREEN */     /* overlay (Blockade/Hustle) */
  455. };
  456. static unsigned char bw_palette[] =
  457. {
  458.     0x00,0x00,0x00, /* BLACK */
  459.     0xff,0xff,0xff, /* WHITE */     /* Comotion/Blasto */
  460. };
  461. static void init_palette_gr(unsigned char *game_palette, unsigned short *game_colortable,const unsigned char *color_prom)
  462. {
  463.     memcpy(game_palette,gr_palette,sizeof(gr_palette));
  464. }
  465. static void init_palette_bw(unsigned char *game_palette, unsigned short *game_colortable,const unsigned char *color_prom)
  466. {
  467.     memcpy(game_palette,bw_palette,sizeof(bw_palette));
  468. }
  469.  
  470.  
  471.  
  472. static const char *blockade_sample_names[] =
  473. {
  474.     "*blockade",
  475.     "BOOM.wav",
  476.     0   /* end of array */
  477. };
  478.  
  479. static struct Samplesinterface samples_interface =
  480. {
  481.     1,    /* 1 channel */
  482.     25,    /* volume */
  483.     blockade_sample_names
  484. };
  485.  
  486.  
  487.  
  488. static struct MachineDriver machine_driver_blockade =
  489. {
  490.     /* basic machine hardware */
  491.     {
  492.         {
  493.             CPU_8080,
  494.             2079000,
  495.             readmem,writemem,readport,writeport,
  496.             blockade_interrupt,1
  497.         },
  498.     },
  499.         60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  500.         1,
  501.     0,
  502.  
  503.     /* video hardware */
  504.     32*8, 28*8, { 0*8, 32*8-1, 0*8, 28*8-1 },
  505.     gfxdecodeinfo,
  506.     2, 2,
  507.     init_palette_gr,
  508.  
  509.     VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
  510.     0,
  511.     generic_vh_start,
  512.     generic_vh_stop,
  513.     blockade_vh_screenrefresh,
  514.  
  515.     /* sound hardware */
  516.     0,0,0,0,
  517.     {
  518.         {
  519.             SOUND_SAMPLES,
  520.             &samples_interface
  521.         }
  522.     }
  523. };
  524.  
  525. static struct MachineDriver machine_driver_comotion =
  526. {
  527.     /* basic machine hardware */
  528.     {
  529.         {
  530.             CPU_8080,
  531.             2079000,
  532.             readmem,writemem,readport,writeport,
  533.             blockade_interrupt,1
  534.         },
  535.     },
  536.         60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  537.         1,
  538.     0,
  539.  
  540.     /* video hardware */
  541.     32*8, 28*8, { 0*8, 32*8-1, 0*8, 28*8-1 },
  542.     gfxdecodeinfo,
  543.     2, 2,
  544.     init_palette_bw,
  545.  
  546.     VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
  547.     0,
  548.     generic_vh_start,
  549.     generic_vh_stop,
  550.     blockade_vh_screenrefresh,
  551.  
  552.     /* sound hardware */
  553.     0,0,0,0,
  554.     {
  555.         {
  556.             SOUND_SAMPLES,
  557.             &samples_interface
  558.         }
  559.     }
  560. };
  561.  
  562. static struct MachineDriver machine_driver_blasto =
  563. {
  564.     /* basic machine hardware */
  565.     {
  566.         {
  567.             CPU_8080,
  568.             2079000,
  569.             readmem,writemem,readport,writeport,
  570.             blockade_interrupt,1
  571.         },
  572.     },
  573.         60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  574.         1,
  575.     0,
  576.  
  577.     /* video hardware */
  578.     32*8, 28*8, { 0*8, 32*8-1, 0*8, 28*8-1 },
  579.     blasto_gfxdecodeinfo,
  580.     2, 2,
  581.     init_palette_bw,
  582.  
  583.     VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
  584.     0,
  585.     generic_vh_start,
  586.     generic_vh_stop,
  587.     blockade_vh_screenrefresh,
  588.  
  589.     /* sound hardware */
  590.     0,0,0,0,
  591.     {
  592.         {
  593.             SOUND_SAMPLES,
  594.             &samples_interface
  595.         }
  596.     }
  597. };
  598.  
  599. static struct MachineDriver machine_driver_hustle =
  600. {
  601.     /* basic machine hardware */
  602.     {
  603.         {
  604.             CPU_8080,
  605.             2079000,
  606.             readmem,writemem,readport,writeport,
  607.             blockade_interrupt,1
  608.         },
  609.     },
  610.         60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  611.         1,
  612.     0,
  613.  
  614.     /* video hardware */
  615.     32*8, 28*8, { 0*8, 32*8-1, 0*8, 28*8-1 },
  616.     blasto_gfxdecodeinfo,
  617.     2, 2,
  618.     init_palette_gr,
  619.  
  620.     VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
  621.     0,
  622.     generic_vh_start,
  623.     generic_vh_stop,
  624.     blockade_vh_screenrefresh,
  625.  
  626.     /* sound hardware */
  627.     0,0,0,0,
  628.     {
  629.         {
  630.             SOUND_SAMPLES,
  631.             &samples_interface
  632.         }
  633.     }
  634. };
  635.  
  636. /***************************************************************************
  637.  
  638.   Game driver(s)
  639.  
  640. ***************************************************************************/
  641.  
  642. ROM_START( blockade )
  643.     ROM_REGION( 0x10000, REGION_CPU1 ) /* 64k for code */
  644.     /* Note: These are being loaded into a bogus location, */
  645.     /*       They are nibble wide rom images which will be */
  646.     /*       merged and loaded into the proper place by    */
  647.     /*       blockade_rom_init()                           */
  648.     ROM_LOAD( "316-04.u2", 0x1000, 0x0400, 0xa93833e9 )
  649.     ROM_LOAD( "316-03.u3", 0x1400, 0x0400, 0x85960d3b )
  650.  
  651.     ROM_REGION( 0x200, REGION_GFX1 | REGIONFLAG_DISPOSE )
  652.     ROM_LOAD( "316-02.u29", 0x0000, 0x0100, 0x409f610f )
  653.     ROM_LOAD( "316-01.u43", 0x0100, 0x0100, 0x41a00b28 )
  654. ROM_END
  655.  
  656. ROM_START( comotion )
  657.     ROM_REGION( 0x10000, REGION_CPU1 ) /* 64k for code */
  658.     /* Note: These are being loaded into a bogus location, */
  659.     /*       They are nibble wide rom images which will be */
  660.     /*       merged and loaded into the proper place by    */
  661.     /*       comotion_rom_init()                           */
  662.     ROM_LOAD( "316-07.u2", 0x1000, 0x0400, 0x5b9bd054 )
  663.     ROM_LOAD( "316-08.u3", 0x1400, 0x0400, 0x1a856042 )
  664.     ROM_LOAD( "316-09.u4", 0x1800, 0x0400, 0x2590f87c )
  665.     ROM_LOAD( "316-10.u5", 0x1c00, 0x0400, 0xfb49a69b )
  666.  
  667.     ROM_REGION( 0x200, REGION_GFX1 | REGIONFLAG_DISPOSE )
  668.     ROM_LOAD( "316-06.u43", 0x0000, 0x0100, 0x8f071297 )  /* Note: these are reversed */
  669.     ROM_LOAD( "316-05.u29", 0x0100, 0x0100, 0x53fb8821 )
  670. ROM_END
  671.  
  672. ROM_START( blasto )
  673.     ROM_REGION( 0x10000, REGION_CPU1 ) /* 64k for code */
  674.     /* Note: These are being loaded into a bogus location, */
  675.     /*       They are nibble wide rom images which will be */
  676.     /*       merged and loaded into the proper place by    */
  677.     /*       comotion_rom_init()                           */
  678.     ROM_LOAD( "blasto.u2", 0x1000, 0x0400, 0xec99d043 )
  679.     ROM_LOAD( "blasto.u3", 0x1400, 0x0400, 0xbe333415 )
  680.     ROM_LOAD( "blasto.u4", 0x1800, 0x0400, 0x1c889993 )
  681.     ROM_LOAD( "blasto.u5", 0x1c00, 0x0400, 0xefb640cb )
  682.  
  683.     ROM_REGION( 0x400, REGION_GFX1 | REGIONFLAG_DISPOSE )
  684.     ROM_LOAD( "blasto.u29", 0x0000, 0x0200, 0x4dd69499 )
  685.     ROM_LOAD( "blasto.u43", 0x0200, 0x0200, 0x104051a4 )
  686. ROM_END
  687.  
  688. ROM_START( hustle )
  689.     ROM_REGION( 0x10000, REGION_CPU1 ) /* 64k for code */
  690.     /* Note: These are being loaded into a bogus location, */
  691.     /*       They are nibble wide rom images which will be */
  692.     /*       merged and loaded into the proper place by    */
  693.     /*       comotion_rom_init()                           */
  694.     ROM_LOAD( "3160016.u2", 0x1000, 0x0400, 0xd983de7c )
  695.     ROM_LOAD( "3160017.u3", 0x1400, 0x0400, 0xedec9cb9 )
  696.     ROM_LOAD( "3160018.u4", 0x1800, 0x0400, 0xf599b9c0 )
  697.     ROM_LOAD( "3160019.u5", 0x1c00, 0x0400, 0x7794bc7e )
  698.  
  699.     ROM_REGION( 0x400, REGION_GFX1 | REGIONFLAG_DISPOSE )
  700.     ROM_LOAD( "3160020.u29", 0x0000, 0x0200, 0x541d2c67 )
  701.     ROM_LOAD( "3160021.u43", 0x0200, 0x0200, 0xb5083128 )
  702. ROM_END
  703.  
  704.  
  705.  
  706. GAMEX( 1976, blockade, 0, blockade, blockade, blockade, ROT0, "Gremlin", "Blockade", GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL )
  707. GAMEX( 1976, comotion, 0, comotion, comotion, comotion, ROT0, "Gremlin", "Comotion", GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL )
  708. GAMEX( 1978, blasto,   0, blasto,   blasto,   comotion, ROT0, "Gremlin", "Blasto", GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL )
  709. GAMEX( 1977, hustle,   0, hustle,   hustle,   comotion, ROT0, "Gremlin", "Hustle", GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL )
  710.